package com.melon.controller;

import com.melon.entity.PowerAssistServiceInfoVM;
import com.melon.entity.Response;
import com.melon.handler.PowerAssistHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author TianGua
 * @since 2024/6/26 - 16:39
 */
@RestController
@RequestMapping("/power/assist")
public class PowerAssistController {

    @Autowired
    private PowerAssistHandler powerAssistHandler;

    @GetMapping("/info")
    public Response<PowerAssistServiceInfoVM> info() {
        return Response.ok(powerAssistHandler.getOwnerServiceInfo());
    }

    @PostMapping()
    public Response<Boolean> assist(@RequestParam(value = "type") Integer type, @RequestParam(value = "count") Integer count) {
        return Response.ok(powerAssistHandler.assist(type, count));
    }




}
